﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DesignPattrn
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            DesignPatten.Delegate.ThreadCountChanged+=new DesignPatten.Delegate.ThreadCountChangedEventHandler(Delegate_SignProperty);
        }

        void Delegate_SignProperty(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
        }

        private void CreThreadBtn_Click(object sender, EventArgs e)
        {
            // TODO: create a thread and put the new one to thread list

            // increase global threads count by one
            DesignPatten.Delegate.GlobalCount++;
        }

        private void DelThreadBtn_Click(object sender, EventArgs e)
        {
            // TODO: terminate a thread and put remove it from thread list

            // decrease global threads count by one
            DesignPatten.Delegate.GlobalCount--;
        }
    }
}
